package com.codepoem.designpattern.observer

/**
 * 观察者模式测试
 */
fun main(args: Array<String>) {
    var s: ConcreteSubject = ConcreteSubject()
    s.attach(ConcreteObserver(s, "X"))
    s.attach(ConcreteObserver(s, "Y"))
    s.attach(ConcreteObserver(s, "Z"))

    s.subjectState = "ABC"
    s.notifyObservers()
}
